﻿<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/shipLot/shipLot" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="shipLot" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <label>产品名称：</label>
            %{--<input name='PART_NAME' value="${PART_NAME}" size="18"/>--}%
            <g:select name="PART_NAME" from="${shipPartNameList}" data-toggle="selectpicker" data-width="180" data-live-search="true" optionKey="PART_NAME" optionValue="PART_NAME" value="${PART_NAME}" noSelection="['':'--ALL--']" />
            <label>扩散批号：</label>
            <input name='SUBSTRATE_ID1' value="${SUBSTRATE_ID1}" size="18"/>
            <label>封装形式：</label>
            %{--<input name='RESERVED1' value="${RESERVED1}" size="18"/>--}%
            <g:select name="RESERVED1" from="${packageForm}" data-toggle="selectpicker" data-width="180" data-live-search="true" optionKey="RESERVED1" optionValue="RESERVED1" value="${RESERVED1}" noSelection="['':'--ALL--']" />
            <br/>
            <label>档&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位：</label>
            <input name='GRADE1' value="${GRADE1}" size="18"/>
            <label>数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量：</label>
            <input name='MAIN_QTY' value="${MAIN_QTY}" size="18"/>
            <br/>
            <label>入库开始时间<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="start-date-input" readonly value="${startTime.format('yyyy-MM-dd HH:mm:ss')}">&nbsp;
            <label>入库结束时间<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="endTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="end-date-input" readonly value="${endTime.format('yyyy-MM-dd HH:mm:ss')}" >&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/shipLot/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出Excel文件</button>&nbsp;
        </div>
    </form>
</div>
<g:if test="${shipLot.size > 0}">
<div class="bjui-pageContent">

        <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr>
                <th align="center" width="60">NO.</th>
                <th align="center" width="60">封装厂名</th>
                <th align="center" width="120">箱号</th>
                <th align="center" width="150">产品名称</th>
                <th align="center" width="80">封装形式</th>
                <th align="center" width="100">标签批号</th>
                <th align="center" width="100">扩散批号</th>
                <th align="center" width="60">档位</th>
                <th align="center" width="100">周记</th>
                <th align="center" width="100">入库数量(PCS)</th>
                <th align="center" width="150">客户名称</th>
                <th align="center" width="290">收货地址</th>
                <th align="center" width="160">入库日期</th>
                <th align="center" width="150">客户订单号</th>
            </tr>
            </thead>
            <tbody>
            <g:each in="${shipLot}" status="i" var="tableInstance">
                <tr>
                    <td align="center" width="60">${i+1}</td>
                    <td align="center" width="60">${tableInstance.SITE_NAME}</td>
                    <td align="center" width="120">${tableInstance.LOT_ID}</td>
                    <td align="center" width="150">${tableInstance.PART_NAME}</td>
                    <td align="center" width="80">${tableInstance.RESERVED1}</td>
                    <td align="center" width="100">${tableInstance.RESERVED3}</td>
                    <td align="center" width="100">${tableInstance.SUBSTRATE_ID1}</td>
                    <td align="center" width="60">${tableInstance.GRADE1}</td>
                    <td align="center" width="100">${tableInstance.RESERVED4}</td>
                    <td align="center" width="100" name="ageSum${i}">${tableInstance.MAIN_QTY}</td>
                    <td align="center" width="150">${tableInstance.SHORT_NAME1}</td>
                    <td align="center" width="150">${tableInstance.DESCRIPTION}</td>
                    <td align="center" width="160">${tableInstance.UPDATED}</td>
                    <td align="center" width="150">${tableInstance.CUSTOMER_ORDER}</td>
                </tr>
            </g:each>
            <tr>
                <td colspan="2" align="center">入库数量合计</td>
                <td name="ageShow"colspan="12" align="center"  ></td>
            </tr>
            </tbody>
        </table>
</div>
</g:if>
<script>
    $(function () {
        var ageResult = 0;   /*定义一个薪资遍历*/
        for (var i = 0; i <${shipLot.size()}; i++) {  /*遍历主demo3函数*/
            var ageAddSum = 'ageSum' + i    /*在上面定义 salarysum行的结果*/
            var ageAdd = $("td[name='" + ageAddSum + "']").text() == '' ? 0 : parseInt($("td[name='" + ageAddSum + "']").text())
            ageResult += ageAdd
        }
        $("td[name='ageShow']").html(ageResult)
    })
</script>